import 'package:flutter/material.dart';
import 'package:flutter_xyf/pages/component/app_bar/index.dart';

class ModalBottom extends StatelessWidget {
  const ModalBottom({Key? key}) : super(key: key);

  showBottom(context) {
    showModalBottomSheet(
        context: context,
        isScrollControlled: true, //表示为全屏
        backgroundColor: Colors.transparent, //重点
        builder: (BuildContext context) {
          return Container(
            decoration: BoxDecoration(
                borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(10),
                    topRight: Radius.circular(10)),
                color: Colors.white),
            height: MediaQuery.of(context).size.height - 100,
          );
        });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(title: '底部弹窗'),
      body: Column(
        children: [
          ElevatedButton(
              onPressed: () {
                showBottom(context);
              },
              child: Text('展示底部弹窗'))
        ],
      ),
    );
  }
}
